<template>
  <!-- 气泡容器 -->
  <div class="bubble-container">
	  <span class="bubble"></span>
	  <span class="bubble"></span>
	  <span class="bubble"></span>
	  <span class="bubble"></span>
	  <span class="bubble"></span>
	  <span class="bubble"></span>
	  <span class="bubble"></span>
	  <span class="bubble"></span>
	  <span class="bubble"></span>
	  <span class="bubble"></span>
  </div>
  <!-- 标题 -->
  <h4 class="text-center" style="color: black;font-size: 26px;">用户管理</h4>
  <!-- 用户列表 -->
  <table border>
    <thead>
      <tr>
        <th>编号</th>
        <th>姓名</th>
        <th>等级</th>
        <th>操作</th>
      </tr>
    </thead>
    <tbody>
      <tr v-for="item in userlist" :key="item.id">
        <td>{{ item.id }}</td>
        <td>{{ item.name }}</td>
        <td>{{ item.level }}</td>
        <td>
          <router-link :to="`/home/users/${item.id}/${item.name}/${item.level}`">详情</router-link>
        </td>
      </tr>
    </tbody>
  </table> 
</template>

<script setup>
import { useRouter } from 'vue-router'
const router = useRouter()
const userlist = [
  { id: '1', name: '小明', level: '一级客户' },
  { id: '2', name: '小红', level: '二级客户' },
  { id: '3', name: '小兰', level: '三级客户' },
  { id: '4', name: '小芳', level: '四级客户' },
]
</script>
<style scoped>
	
table {
  width: 100%;
  border-collapse: collapse;
  border: none;
  font-family: Arial, sans-serif;
}

th, td {
  padding: 12px 15px;
  border-bottom: 1px solid #ddd;
}

th {
  background-color: #e0e0e0;
  font-weight: bold;
}

tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}

tbody tr:hover {
  background-color: #ffff7f;
  color: #aa0000;
  font-size: 18px;
}
.bubble-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.bubble {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(34, 170, 255, 0.8), rgba(252, 206, 255, 0.7));
  box-shadow: 0 0 10px rgba(0, 123, 255, 0.5);
  animation: float linear infinite;

  &:nth-child(1) {
    width: 20px;
    height: 20px;
    left: 5%;
    bottom: -20px;
    animation-duration: 10s;
  }
  &:nth-child(2) {
    width: 30px;
    height: 30px;
    left: 15%;
    bottom: -30px;
    animation-duration: 12s;
  }
  &:nth-child(3) {
    width: 15px;
    height: 15px;
    left: 25%;
    bottom: -15px;
    animation-duration: 8s;
  }
  &:nth-child(4) {
    width: 25px;
    height: 25px;
    left: 35%;
    bottom: -25px;
    animation-duration: 11s;
  }
  &:nth-child(5) {
    width: 35px;
    height: 35px;
    left: 45%;
    bottom: -35px;
    animation-duration: 13s;
  }
  &:nth-child(6) {
    width: 18px;
    height: 18px;
    left: 55%;
    bottom: -18px;
    animation-duration: 9s;
  }
  &:nth-child(7) {
    width: 22px;
    height: 22px;
    left: 65%;
    bottom: -22px;
    animation-duration: 10.5s;
  }
  &:nth-child(8) {
    width: 28px;
    height: 28px;
    left: 75%;
    bottom: -28px;
    animation-duration: 12.5s;
  }
  &:nth-child(9) {
    width: 12px;
    height: 12px;
    left: 85%;
    bottom: -12px;
    animation-duration: 7s;
  }
  &:nth-child(10) {
    width: 32px;
    height: 32px;
    left: 95%;
    bottom: -32px;
    animation-duration: 14s;
  }
}

@keyframes float {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(-100vh);
    opacity: 0;
  }
}
</style>